-
-
Notifications
You must be signed in to change notification settings - Fork 311
feat: update postgres to 18 Debian-based and release *-pg18 Docker builds
#3035
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughPostgreSQL image versions were updated across Docker configs and tooling: several services and the Dockerfile moved to postgres:16.8; the Gradle task uses postgres:16.8; one Kotlin test runner now references postgres:18.0; GitHub workflow adds legacy Dockerfile usage and -pg18 image tags. No public API changes. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20–30 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Well well well, after a bit of digging, it seems like that PR accidentally found some bugs... 🙃 There was issues with sorting because using Alpine (like in the distributed image..!) means using musl libc, which has very limited support for fancy locales stuff and was only doing bytewise comparisons. Thankfully, since PostgreSQL 15 we can rely on ICU instead, which appears to solve the issues. Tests still fail, but after glancing at the results it seems the tests are the problem this time, but I didn't investigate further. |
724ebc1 to
befd300
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
backend/misc/src/main/kotlin/io/tolgee/misc/dockerRunner/DockerContainerRunner.kt (1)
129-135: Improved command string processing to handle escaped spaces correctly.The updated implementation uses a more sophisticated regex pattern with a negative lookbehind assertion (
(?<!\\)\\s+) to ensure that escaped spaces in command arguments are preserved during splitting. This is followed by a mapping operation that converts these escaped spaces to regular spaces.This enhancement is important for correctly processing Docker commands that might include arguments with spaces, such as container names or paths with spaces, which need to be escaped in the command line.
Consider adding a brief comment explaining the purpose of this regex and transformation for future maintainability:
private fun String.startProcess( workingDir: File, timeoutAmount: Long, timeoutUnit: TimeUnit, ): Process { + // Split command by whitespace but preserve escaped spaces, then convert escaped spaces to regular spaces val transformed = "(?<!\\\\)\\s+" .toRegex() .split(this.trim()) .map { it.replace("\\ ", " ") } return ProcessBuilder(transformed)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
backend/app/src/main/kotlin/io/tolgee/postgresRunners/PostgresDockerRunner.kt(2 hunks)backend/misc/src/main/kotlin/io/tolgee/misc/dockerRunner/DockerContainerRunner.kt(1 hunks)build.gradle(1 hunks)docker/app/Dockerfile(1 hunks)docker/docker-compose.template.yml(1 hunks)docker/docker-compose.yml(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
- backend/app/src/main/kotlin/io/tolgee/postgresRunners/PostgresDockerRunner.kt
- build.gradle
- docker/app/Dockerfile
- docker/docker-compose.template.yml
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Build backend 🏗️
🔇 Additional comments (3)
docker/docker-compose.yml (3)
3-3: Update DB Service Image VersionThe
dbservice now usespostgres:16.8-alpine3.21, which aligns with the PR objective to update PostgreSQL image references. This change is properly applied.
7-8: Introduce POSTGRES_INITDB_ARGS for ICU Locale SupportAdding the
POSTGRES_INITDB_ARGSenvironment variable with the arguments--locale-provider=icu --icu-locale=und-u-kn-trueis a critical enhancement. This change leverages ICU for proper locale handling and better sorting behavior. Please ensure that the initialization arguments are tested in your test environment so that they produce the expected locale settings.
19-19: Clarify SMTP Service Image ChangeThe SMTP service image on line 19 is updated to
namshi/smtp. Since the primary PR objective focuses on updating PostgreSQL image references, please confirm whether this change was intentional. If it is part of a broader update, it would be helpful to include additional context in the PR description.
befd300 to
92bb8f9
Compare
|
Well, given the amount of issues surfaced by trying Alpine images, I think it's best for now to stick to Debian-based images, and experiment with Alpine images more thoroughly later. I am unsure if the configuration I tried to use with Alpine ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
docker/app/Dockerfile (1)
5-10: APT Installation and Cleanup BlockThe heredoc RUN block correctly:
- Enables strict mode with
set -eux- Updates the apt cache quietly
- Installs
temurin-21-jdkandlibxml2in a single layer- Cleans up the apt lists to reduce image size
As an optional improvement, consider setting the environment variable
DEBIAN_FRONTEND=noninteractiveto suppress any interactive prompts during package installation. Here’s a diff suggestion:-FROM postgres:16.8 +FROM postgres:16.8 +ENV DEBIAN_FRONTEND=noninteractiveThis change can help ensure that the build stays non-interactive even if future package changes introduce prompts.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
docker/app/Dockerfile(1 hunks)
🔇 Additional comments (1)
docker/app/Dockerfile (1)
1-1: Base Image Update VerificationThe base image has been updated to
postgres:16.8, consistent with the PR objective to move to a Debian-based PostgreSQL image. Please verify that the default variant forpostgres:16.8is indeed Debian-based as expected.
182b46a to
ac497e9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
docker/app/Dockerfile (1)
5-15: Streamlined RUN Block with Apt CommandsThe multi-line RUN block is well-structured. It updates the package lists, installs wget to fetch the Adoptium GPG key, configures the Adoptium repository, installs
temurin-21-jdkandlibxml2, and then cleans up by removing wget and clearing cached package lists. This helps keep the Docker image size lean.One optional enhancement is to ensure noninteractive installation by setting the
DEBIAN_FRONTENDenvironment variable. This can help prevent any unforeseen interactive prompts during package installation. You can either add it as a global environment variable or prepend it to the RUN command. For instance:+ENV DEBIAN_FRONTEND=noninteractiveOr modify the RUN command as follows:
-RUN <<EOF +RUN export DEBIAN_FRONTEND=noninteractive && <<EOFThis change is optional but can improve reliability in automated builds.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
docker/app/Dockerfile(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Frontend static check 🪲
- GitHub Check: Build backend 🏗️
- GitHub Check: Build frontend 🏗️
🔇 Additional comments (1)
docker/app/Dockerfile (1)
1-1: Base Image Update VerificationThe base image has been correctly updated to
postgres:16.8, which aligns with the PR objective of moving to a Debian-based image with the latest PostgreSQL version. Please confirm that all dependent tools and configurations in the project are compatible with this image.
|
Thanks a lot for the PR anyway! ❤️ Btw. What prevent us from upgrading to Postgres 17? |
Probably nothing tbh. I just stayed on 16 since that's what was used in all the tests 😅 |
|
any update on that? |
|
We currently cannot proceed with this, because there are many users with embedded Postgres. We might consider sunset the embedded Postgres and introduce new major version with breaking change, letting the users migrate themselves for example. Still we might need some migration guide. |
musl libc's reduced feature-set causes unexpected issues with ordering existing workarounds seem to surface more unexpected issues as well let's go for the easy solution first
ac497e9 to
fabd161
Compare
|
Having this upgrade stuck bothered me, so I'm proposing an alternative approach: keep the existing releases on pg13 but start building Hopefully this will unblock this situation which is starting to become quite critical with PostgreSQL 13's EOL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/release.yml(1 hunks)backend/app/src/main/kotlin/io/tolgee/postgresRunners/PostgresDockerRunner.kt(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- backend/app/src/main/kotlin/io/tolgee/postgresRunners/PostgresDockerRunner.kt
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: laz-001
Repo: tolgee/tolgee-platform PR: 0
File: :0-0
Timestamp: 2025-05-09T01:35:14.224Z
Learning: Changes to PostgreSQL container names, ports, Liquibase changelog paths, and test data directories in the Tolgee platform are often made to provide dedicated resources to parallel test groups (like `ee-test:test` and `server-app:test`), preventing resource congestion and collisions that could lead to deadlocks during testing.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
- GitHub Check: BT 🔎 (server-app:runWithoutEeTests)
- GitHub Check: BT 🔎 (ktlint:test)
- GitHub Check: BT 🔎 (data:test)
- GitHub Check: BT 🔎 (security:test)
- GitHub Check: BT 🔎 (ee-test:test)
- GitHub Check: BT 🔎 (server-app:runStandardTests)
- GitHub Check: BT 🔎 (server-app:runContextRecreatingTests)
- GitHub Check: BT 🔎 (server-app:runWebsocketTests)
- GitHub Check: Frontend static check 🪲
- GitHub Check: Build frontend 🏗️
*-pg18 Docker builds
See #3033
Summary by CodeRabbit